<template>
  <view >
    <view class="alipay-chat">
      <contact-button
          class="ali-chat"
          :tnt-inst-id="aliChat.rent_id"
          :scene="aliChat.chat_id"
          :size="size"
          :icon="icon"
      />
    </view>
  </view>
</template>

<script>
import {getAliChat} from "@/api/public";

export default {
  props:{
    from_icon:{
      type: String,
      default: ''
    },
    from_size:{
    },
  },
  data() {
    return {
      aliChat: {},
      icon: 'https://qn.ebaozu.cn/public/mini/static/alipayChat.png',
      size:22
    }
  },
  mounted() {
    if(this.from_icon){
      this.icon=this.from_icon
    }
    if(this.from_size){
      this.size=this.from_size
    }
    this.getAliChat()
  },
  methods: {
    getAliChat() {
      getAliChat().then(res=>{
        if(res.status===200){
          this.aliChat=res.data || {}

        }
      })
    }
  },
}
</script>

<style lang="scss" scoped>
.alipay-chat{
  //position: absolute;
  //top: 620rpx;
  //left: 20rpx;
}
</style>
<style lang="scss">
/deep/contact-button{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 10;
}
</style>